{{define "content"}}
<div class="container mx-auto px-4 py-8">
    <h1 class="text-3xl font-bold mb-6">权限调试页面</h1>
    
    <div class="bg-white shadow rounded-lg p-6 mb-6">
        <h2 class="text-xl font-semibold mb-4">用户信息:</h2>
        <p><strong>用户ID:</strong> {{.User.ID}}</p>
        <p><strong>用户名:</strong> {{.User.Username}}</p>
        <p><strong>邮箱:</strong> {{.User.Email}}</p>
    </div>
    
    <div class="bg-white shadow rounded-lg p-6 mb-6">
        <h2 class="text-xl font-semibold mb-4">权限列表:</h2>
        {{if .User.Permissions}}
            <ul class="list-disc list-inside space-y-1">
            {{range .User.Permissions}}
                <li class="text-green-600">{{.}}</li>
            {{end}}
            </ul>
            <p class="mt-4 text-sm text-gray-600">权限总数: {{len .User.Permissions}}</p>
        {{else}}
            <p class="text-red-600 font-semibold">权限列表为空或未加载!</p>
        {{end}}
    </div>
    
    <div class="bg-white shadow rounded-lg p-6">
        <h2 class="text-xl font-semibold mb-4">权限检查测试:</h2>
        <div class="space-y-2">
            <p>partner.update权限: {{if hasPermission .User.Permissions "partner.update"}}<span class="text-green-600 font-semibold">✅ 有权限</span>{{else}}<span class="text-red-600 font-semibold">❌ 无权限</span>{{end}}</p>
            <p>partner.create权限: {{if hasPermission .User.Permissions "partner.create"}}<span class="text-green-600 font-semibold">✅ 有权限</span>{{else}}<span class="text-red-600 font-semibold">❌ 无权限</span>{{end}}</p>
            <p>partner.delete权限: {{if hasPermission .User.Permissions "partner.delete"}}<span class="text-green-600 font-semibold">✅ 有权限</span>{{else}}<span class="text-red-600 font-semibold">❌ 无权限</span>{{end}}</p>
        </div>
    </div>
</div>
{{end}}